using UnityEngine;
using System.Collections;
using System.Collections.Generic;


public class objectMove : MonoBehaviour 
{
	public List<GameObject> m_objects;
	public GameObject m_face = null;
	public GameObject prefab_rotor = null;
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
		if (Input.GetKeyDown(KeyCode.Space))
		{
			GameObject o = Instantiate(prefab_rotor) as GameObject;
			iTween.ScaleTo(m_face, new Hashtable{{"x", 10.0f}, {"y", 10.0f}, {"z", 10.0f}});
			foreach(GameObject go in m_objects)
			{
				if (go.rigidbody == null)
					go.AddComponent<Rigidbody>();
				Vector3 explosionDir = go.transform.position.normalized;
				go.rigidbody.AddExplosionForce(5000.0f, explosionDir, 1000.0f, 10.0f);
			}
		}
	
	}
}
